<script setup lang="ts">
import {ref} from 'vue'
import {Document, Pear, Notebook, Check, Delete, Edit, Message, Search, Star,} from '@element-plus/icons-vue'
import {ElMessage} from "element-plus";

const load = ref(false)
const open1 = () => {
  ElMessage('this is a message.')
}

const open2 = () => {
  ElMessage({
    message: '成功登录',
    duration: 3000,
    onClose: () => {
      location.href = 'http://www.baidu.com'
    },
    showClose: true,
    type: 'info' // success warning error info
  })
}
</script>

<template>

  <el-row class="mb-4">
    <el-button>Default</el-button>
    <el-button type="primary" @click="open1">Primary - ElMessage</el-button>
    <el-button type="success" @click="open2">Success</el-button>
    <el-button type="info">Info</el-button>
    <el-button type="warning">Warning</el-button>
    <el-button type="danger">Danger</el-button>
  </el-row>
  <br>
  <el-row class="mb-4">
    <el-button plain>Plain</el-button>
    <el-button type="primary" plain>Primary</el-button>
    <el-button type="success" plain>Success</el-button>
    <el-button type="info" plain>Info</el-button>
    <el-button type="warning" plain>Warning</el-button>
    <el-button type="danger" plain>Danger</el-button>
  </el-row>
  <br>
  <el-row class="mb-4">
    <el-button round>Round</el-button>
    <el-button type="primary" round>Primary</el-button>
    <el-button type="success" round>Success</el-button>
    <el-button type="info" round>Info</el-button>
    <el-button type="warning" round>Warning</el-button>
    <el-button type="danger" round>Danger</el-button>
  </el-row>
  <br>
  <el-row>
    <el-button :icon="Search" circle/>
    <el-button type="primary" :icon="Edit" circle/>
    <el-button type="success" :icon="Check" circle/>
    <el-button type="info" :icon="Message" circle/>
    <el-button type="warning" :icon="Star" circle/>
    <el-button type="danger" :icon="Delete" circle/>
  </el-row>
  <br>
  <el-row>
    <el-button type="primary" @click="load=true" :loading="load" :icon="Document">提交</el-button>
    <el-button size="default" plain type="success" :icon="Notebook">新用户注册</el-button>
    <el-button round type="warning" :icon="Pear">删除用户</el-button>
  </el-row>
</template>

<style scoped>

</style>
